package cn.example.common.protocol.structs;

import lombok.Data;
import java.util.Map;
import cn.hutool.core.map.MapUtil;
import org.artifact.core.lang.DTO;
@Data
/**
 * 英雄
 */
public class HeroDTO implements DTO{
	/** 唯一标示 */
	private long id;
	/** 配置ID */
	private int cid;
	/** 等级 */
	private int lv;
	/** 经验 */
	private int exp;
	/** 属性 */
	private java.util.Map<java.lang.Integer, java.lang.Integer> attr = new java.util.HashMap<>();

	public Map<Object, Object> toMap(Map<Object, Object> map){
		map.put(3355,this.id);
		map.put(98494,this.cid);
		map.put(3466,this.lv);
		map.put(100893,this.exp);
		map.put(3004913,this.attr);
	    return map;
	}

	public HeroDTO forMap(Map<Object, Object> map){
        this.id = MapUtil.getLong(map ,3355);
        this.cid = MapUtil.getInt(map ,98494);
        this.lv = MapUtil.getInt(map ,3466);
        this.exp = MapUtil.getInt(map ,100893);
        this.attr = MapUtil.get(map ,3004913,java.util.Map.class);
        return this;
    }
}